/* This is the replication file for "Childhood Socialization and Political Attitudes: Evidence from a Natural Experiment,"
	Andrew Healy and Neil Malhotra, 2013, Journal of Politics (Part 2 of 2)  */
	
use nlsy_replication_file, clear


/***** TABLE 3 *****/
/* Column 1 */
ivreg gr06_x (sis_share =  younger_sister) numsib if cgender==0&sis_share<=1, cluster(mid)
ivreg gr06_x (sis_share =  younger_sister) numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 2 */
xi: ivreg gr06_x (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg gr06_x (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 3 */
reg gr06_x younger_sister numsib if cgender==0&sis_share<=1, cluster(mid)
reg gr06_x younger_sister numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 4 */
xi: reg gr06_x younger_sister i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: reg gr06_x younger_sister i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)


/***** TABLE 4 *****/
/* Column 1 */
ivreg pid08 (sis_share =  younger_sister) numsib if cgender==0&sis_share<=1, cluster(mid)
ivreg pid08 (sis_share =  younger_sister) numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 2 */
xi: ivreg pid08 (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg pid08 (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 3 */
reg pid08 younger_sister numsib if cgender==0&sis_share<=1, cluster(mid)
reg pid08 younger_sister numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 4 */
xi: reg pid08 younger_sister i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: reg pid08 younger_sister i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)



/***** TABLE 5 *****/

drop _merge
sort cid
merge cid using merge_chore_into_rest

/* Column 1 */
xi: ivreg avg_chore (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg avg_chore (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 2 */
xi: ivreg avg_chore_old (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg avg_chore_old (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 3 */
xi: reg avg_chore younger_sister i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: reg avg_chore younger_sister i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 4 */
xi: reg avg_chore_old younger_sister i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: reg avg_chore_old younger_sister i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)





/****** Table S2 *******/


gen rc1 =  momrace==3 if momrace>=0
gen rc2 = usborn==1 if usborn>=0
gen rc3 = southborn==1 if southborn>=0
gen rc4 = forlang==1 if forlang>=0
gen rc5 = urban14==1 if urban14>=0
gen rc6 = grandmausborn==1 if grandmausborn>=0
gen rc7 = grandpausborn==1 if grandpausborn>=0

/* Columns 1-7 (top row) */
forvalues x = 1/7 {
	reg rc`x' younger_sister if cgender==0, cluster(mid)
}

/* Columns 8-14 (top row) */
forvalues x = 1/7 {
	reg rc`x' younger_sister if cgender==1, cluster(mid)
}	


/****** Table S3 *******/

/* Column 4 */
reg sis_share younger_sister if cgender==0&sis_share<=1, cluster(mid)
reg sis_share younger_sister if cgender==1&sis_share<=1, cluster(mid)

/* Column 5 */
reg sis_share younger_sister numsib if cgender==0&sis_share<=1, cluster(mid)
reg sis_share younger_sister numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 6 */
xi: reg sis_share younger_sister i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: reg sis_share younger_sister i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)


/****** Table S4 ********/ 

tab num_bro num_sis if younger_sister!=.&gr06_x!=.&sis_share<=1

tabstat sis_share if sis_share<=1&younger_sister!=.&gr06_x!=., by(numsib) stat(mean sd n)


/****** Table S8 ********/ 

gen nonwhite = crace==1|crace==2 if crace!=.
replace agegap=agegap/10


/* Column 1 */
ivreg gr06_x (sis_share =  younger_sister) gr79 numsib agegap nonwhite rc2 if cgender==0&sis_share<=1, cluster(mid)

/* Column 2 */
xi: ivreg gr06_x (sis_share =  younger_sister) gr79 i.numsib_dum agegap nonwhite rc2 if cgender==0&sis_share<=1, cluster(mid)

/* Column 3 */
reg gr06_x younger_sister gr79 numsib agegap nonwhite rc2 if cgender==0&sis_share<=1, cluster(mid)

/* Column 4 */
xi: reg gr06_x younger_sister gr79 i.numsib_dum agegap nonwhite rc2 if cgender==0&sis_share<=1, cluster(mid)

/* Column 5 */
ivreg pid08 (sis_share =  younger_sister) gr79 numsib agegap border nonwhite rc2 if cgender==0&sis_share<=1, cluster(mid)

/* Column 6 */
xi: ivreg pid08 (sis_share =  younger_sister) gr79 i.numsib_dum agegap border nonwhite rc2 if cgender==0&sis_share<=1, cluster(mid)

/* Column 7 */
reg pid08 younger_sister gr79 numsib agegap border nonwhite rc2 if cgender==0&sis_share<=1, cluster(mid)

/* Column 8 */
xi: reg pid08 younger_sister gr79 i.numsib_dum agegap border nonwhite rc2 if cgender==0&sis_share<=1, cluster(mid)


/****** Table S10 ********/

gen abortion = (abortion08-1)/2 if abortion08>0 

gen gvntwaste = (waste08-5)/-4 if waste08>0

gen gvnt_equalopp = .
recode gvnt_equalopp (.=1) if opportunity08a==1&opportunity08b==1
recode gvnt_equalopp (.=2) if opportunity08a==1&opportunity08b==2
recode gvnt_equalopp (.=3) if opportunity08a==1&opportunity08b==3
recode gvnt_equalopp (.=4) if opportunity08a==3
recode gvnt_equalopp (.=5) if opportunity08a==2&opportunity08c==3
recode gvnt_equalopp (.=6) if opportunity08a==2&opportunity08c==2
recode gvnt_equalopp (.=7) if opportunity08a==2&opportunity08c==1
replace gvnt_equalopp = (gvnt_equalopp-1)/6

gen gvnt_finhelp = .
recode gvnt_finhelp (.=1) if help08a==1&help08b==1
recode gvnt_finhelp (.=2) if help08a==1&help08b==2
recode gvnt_finhelp (.=3) if help08a==1&help08b==3
recode gvnt_finhelp (.=4) if help08a==3
recode gvnt_finhelp (.=5) if help08a==2&help08c==3
recode gvnt_finhelp (.=6) if help08a==2&help08c==2
recode gvnt_finhelp (.=7) if help08a==2&help08c==1
replace gvnt_finhelp = (gvnt_finhelp-1)/6

gen att_scale = (abortion+gvntwaste+gvnt_equalopp+gvnt_finhelp+gr06_x)/5

/* Column 1 */
ivreg abortion (sis_share =  younger_sister) numsib if cgender==0&sis_share<=1, cluster(mid)
ivreg abortion (sis_share =  younger_sister) numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 2 */
xi: ivreg abortion (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg abortion (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 3 */
ivreg gvntwaste (sis_share =  younger_sister) numsib if cgender==0&sis_share<=1, cluster(mid)
ivreg gvntwaste (sis_share =  younger_sister) numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 4 */
xi: ivreg gvntwaste (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg gvntwaste	 (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 5 */
ivreg gvnt_equalopp (sis_share =  younger_sister) numsib if cgender==0&sis_share<=1, cluster(mid)
ivreg gvnt_equalopp (sis_share =  younger_sister) numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 6 */
xi: ivreg gvnt_equalopp (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg gvnt_equalopp	 (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 7 */
ivreg gvnt_finhelp (sis_share =  younger_sister) numsib if cgender==0&sis_share<=1, cluster(mid)
ivreg gvnt_finhelp (sis_share =  younger_sister) numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 8 */
xi: ivreg gvnt_finhelp (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg gvnt_finhelp	 (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 9 */
ivreg att_scale (sis_share =  younger_sister) numsib if cgender==0&sis_share<=1, cluster(mid)
ivreg att_scale (sis_share =  younger_sister) numsib if cgender==1&sis_share<=1, cluster(mid)

/* Column 10 */
xi: ivreg att_scale (sis_share =  younger_sister) i.numsib_dum if cgender==0&sis_share<=1, cluster(mid)
xi: ivreg att_scale	 (sis_share =  younger_sister) i.numsib_dum if cgender==1&sis_share<=1, cluster(mid)

grr


/****** Table S12 *********/

/* Column 1 */
ivreg avg_chore (sis_share =  younger_sister) numsib_dum if cgender==0&sis_share<=1, cluster(mid)
ivreg avg_chore (sis_share =  younger_sister) numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 2 */
ivreg avg_chore_old (sis_share =  younger_sister) numsib_dum if cgender==0&sis_share<=1, cluster(mid)
ivreg avg_chore_old (sis_share =  younger_sister) numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 3 */
reg avg_chore younger_sister numsib_dum if cgender==0&sis_share<=1, cluster(mid)
reg avg_chore younger_sister numsib_dum if cgender==1&sis_share<=1, cluster(mid)

/* Column 4 */
reg avg_chore_old younger_sister numsib_dum if cgender==0&sis_share<=1, cluster(mid)
reg avg_chore_old younger_sister numsib_dum if cgender==1&sis_share<=1, cluster(mid)










